import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    component: () => import('@/views/HomeView.vue'),
    children: [
      {
        path: '/home/people',
        name: '人力资源',
        meta: { title: '人力资源',  },
        component: () => import('@/views/ren/Ren.vue'),
        children: [
          {
            path: '/home/people/bumen',
            name: '部门架构',
            meta: { title: '部门架构' },
            component: () => import('@/views/ren/bumen.vue'),
          },
          {
            path: '/home/people/gangwei',
            name: '岗位职称',
            meta: { title: '岗位职称' },
            component: () => import('@/views/ren/gangwei.vue'),
          },
          {
            path: '/home/people/qiye',
            name: '企业员工',
            meta: { title: '企业员工' },
            component: () => import('@/views/ren/qiye.vue'),
          },
          {
            path: '/home/people/renshi',
            name: '人事调动',
            meta: { title: '人事调动' },
            component: () => import('@/views/ren/renshi.vue'),
          },
          {
            path: '/home/people/lizhi',
            name: '离职档案',
            meta: { title: '离职档案' },
            component: () => import('@/views/ren/lizhi.vue'),
          }
        ]

      },
      {
        path: '/home/xingzheng',
        name: '行政管理',
        meta: { title: '行政管理' },
        component: () => import('@/views/xingzheng/xingzheng.vue'),
        children: [
          {
            path: '/home/xingzheng/yinzhang',
            name: '印章管理',
            meta: { title: '印章管理' },
            component: () => import('@/views/xingzheng/yinzhang.vue'),
          },
          {
            path: '/home/xingzheng/che',
            name: '车辆管理',

            component: () => import('@/views/xingzheng/che.vue'),
          },
          {
            path: '/home/xingzheng/huiyi',
            name: '会议室管理',
            meta: { title: '会议室管理' },
            component: () => import('@/views/xingzheng/huiyi.vue'),
          }
        ]
      },
      {
        path: '/home/qiye',
        name: '企业公告',
        meta: { title: '企业公告' },
        component: () => import('@/views/qiye/qiye.vue'),
        children: [
          {
            path: '/home/qiye/leiix',
            name: '公告类型',
            meta: { title: '公告类型' },
            component: () => import('@/views/qiye/leix.vue'),
          },
          {
            path: '/home/qiye/liebiao',
            name: '公告列表',
            meta: { title: '公告列表' },
            component: () => import('@/views/qiye/leibiao.vue'),
          }
        ]
      },
      {
        path: '/home/bangong',
        name: '办公审批',
        meta: { title: '办公审批' },
        component: () => import('@/views/bangong/bangong.vue'),
        children: [
          {
            path: '/home/bangong/shenpi',
            name: '发起的审批申请',
            meta: { title: '发起的审批申请' },
            component: () => import('@/views/bangong/shenpi.vue'),
          },
          {
            path: '/home/bangong/mypi',
            name: '我发起的',
            meta: { title: '我发起的' },
            component: () => import('@/views/bangong/mypi.vue'),
          },
          {
            path: '/home/bangong/chuli',
            name: '我处理的',
            meta: { title: '我处理的' },
            component: () => import('@/views/bangong/chuli.vue'),
          },
          {
            path: '/home/bangong/chaome',
            name: '抄送我的',
            meta: { title: '抄送我的' },
            component: () => import('@/views/bangong/chaome.vue'),
          }
        ]
      },
      {
        path: '/home/days',
        name: '日常办公',
        meta: { title: '日常办公' },
        component: () => import('@/views/days/days.vue'),
        children: [
          {
            path: '/home/days/anpai',
            name: '日程安排',
            meta: { title: '日程安排' },
            component: () => import('@/views/days/anpai.vue'),
          },
          {
            path: '/home/days/rili',
            name: '日程日历',
            meta: { title: '日程日历' },
            component: () => import('@/views/days/rili.vue'),
          },
          {
            path: '/home/days/jilu',
            name: '工作记录',
            meta: { title: '工作记录' },
            component: () => import('@/views/days/jilu.vue'),
          },
          {
            path: '/home/days/gongzuo',
            name: '工作日历',
            meta: { title: '工作日历' },
            component: () => import('@/views/days/gongzuo.vue'),
          },
          {
            path: '/home/days/huibao',
            name: '工作汇报',
            meta: { title: '工作汇报' },
            component: () => import('@/views/days/huibao.vue'),
          }
        ]
      },
      {
        path: '/home/caiwu',
        name: '财务管理',
        meta: { title: '财务管理' },
        component: () => import('@/views/caiwu/caiwu.vue'),
        children: [
          {
            path: '/home/caiwu/quanixan',
            name: '财务权限配置',
            meta: { title: '财务权限配置' },
            component: () => import('@/views/caiwu/quanixan.vue'),
          },
          {
            path: '/home/caiwu/dao',
            name: '公告列表',
            meta: { title: '公告列表' },
            component: () => import('@/views/caiwu/dao.vue'),
          }
        ]
      },
    ]
  },


  // {
  //   path: '/example',
  //   component: Layout,
  //   meta: { title: 'Example', icon: 'example' },
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/example/index'),
  //       meta: { title: 'Example Index' }
  //     }
  //   ]
  // },
  {
    path: "/",
    redirect: {
      path: '/home'
    },
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
